home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / STUTTGART / LANG / C / LIB / DESK / CORE / Desk / h_doc / PDriver < prev    next >
Text File  |  1996-06-25  |  7KB  |  244 lines

  1. /*
  2.     ####             #    #     # #
  3.     #   #            #    #       #          The FreeWare C library for 
  4.     #   #  ##   ###  #  # #     # ###             RISC OS machines
  5.     #   # #  # #     # #  #     # #  #   ___________________________________
  6.     #   # ####  ###  ##   #     # #  #                                      
  7.     #   # #        # # #  #     # #  #    Please refer to the accompanying
  8.     ####   ### ####  #  # ##### # ###    documentation for conditions of use
  9.     ________________________________________________________________________
  10.  
  11.     File:    PDriver.h
  12.     Author:  Copyright © 1993, 1994 Jason Howat (and a bit by Jason Williams)
  13.     Version: 1.11 (22 Oct 1994)
  14.     Purpose: SWI veneers for using printer drivers (the PDriver module)
  15. */
  16.  
  17.  
  18.  
  19. #ifndef __Desk_PDriver_h
  20. #define __Desk_PDriver_h
  21.  
  22. #ifdef __cplusplus
  23.     extern "C" {
  24. #endif
  25.  
  26.  
  27. #ifndef __Desk_Core_h
  28. #include "Desk.Core.h"
  29. #endif
  30.  
  31. #ifndef __Desk_Wimp_h
  32. #include "Desk.Wimp.h"
  33. #endif
  34.  
  35.  
  36.  
  37. typedef int Desk_print_job;                  /* actually a RISC OS file handle */
  38.  
  39. typedef struct
  40. {
  41.   int xx;
  42.   int xy;
  43.   int yx;
  44.   int yy;
  45. } Desk_print_transformation;                 /* See pg 1554 of the RISC OS 2 PRMs */
  46.  
  47.                                         /* Values for the drivertype field
  48.                                            of Desk_printer_info                 */
  49. #define Desk_printdriver_POSTSCRIPT          0
  50. #define Desk_printdriver_FX80                1
  51. #define Desk_printdriver_LASERJET            2
  52. #define Desk_printdriver_INTEGREX            3   
  53. #define Desk_printdriver_FAXMODEM            4
  54. #define Desk_printdriver_DIRECTDRIVELASER    5
  55. #define Desk_printdriver_CASPELGRAPHLANG     6
  56. #define Desk_printdriver_PDUMPER             7
  57. #define Desk_printdriver_EPSONJX             99
  58. #define Desk_printdriver_STARLC10            99
  59. #define Desk_printdriver_PAINTJET            99
  60.  
  61.  
  62.         /* These #defines represent the bits of the 'features' word */
  63. #define Desk_printfeat_COLOUR         0x00000001
  64. #define Desk_printfeat_LIMITED        0x00000002
  65. #define Desk_printfeat_DISCRETE       0x00000004
  66. #define Desk_printfeat_NOFILL         0x00000100
  67. #define Desk_printfeat_NOTHICKNESS    0x00000200
  68. #define Desk_printfeat_NOOVERWRITE    0x00000400
  69. #define Desk_printfeat_TRANSSPRITE    0x00000800
  70. #define Desk_printfeat_NEWFONTMANAGER 0x00001000
  71. #define Desk_printfeat_SCREENDUMP     0x01000000
  72. #define Desk_printfeat_TRANSFORMS     0x02000000
  73. #define Desk_printfeat_ILLUSTRATIONS  0x04000000
  74. #define Desk_printfeat_MISCOP         0x08000000
  75. #define Desk_printfeat_SETDRIVER      0x10000000
  76. #define Desk_printfeat_DECLAREFONT    0x20000000
  77.  
  78.  
  79.         /* The 'features' word represented as a structure. */
  80. typedef union
  81. {
  82.   int value;
  83.   struct
  84.   {
  85.     unsigned int colour         : 1;
  86.     unsigned int limited        : 1;
  87.     unsigned int discrete       : 1;
  88.     unsigned int filler1        : 5;   /* reserved */
  89.     unsigned int nofill         : 1;
  90.     unsigned int nothickness    : 1;
  91.     unsigned int nooverwrite    : 1;
  92.     unsigned int transsprite    : 1;
  93.     unsigned int newfontmanager : 1;
  94.     unsigned int filler2        : 3;   /* reserved */
  95.     unsigned int filler3        : 8;   /* reserved */
  96.     unsigned int screendump     : 1;
  97.     unsigned int transforms     : 1;
  98.     unsigned int illustrations  : 1;
  99.     unsigned int miscop         : 1;
  100.     unsigned int setdriver      : 1;
  101.     unsigned int declarefont    : 1;
  102.     unsigned int filler4        : 2;   /* reserved */
  103.   } data;
  104. } Desk_print_features;
  105.  
  106.  
  107. typedef struct
  108. {
  109.   unsigned int     version    : 16;
  110.   int              drivertype : 16;
  111.   Desk_wimp_point       resolution;
  112.   Desk_print_features   features;
  113.   char             *description;
  114.   Desk_wimp_point       Desk_halftone_res;
  115.   int              Desk_id_number;
  116. } Desk_printer_info;                  /* info returned by Desk_PDriver_Info (pg 1539) */
  117.  
  118.  
  119.  
  120. void    Desk_PDriver_Info(Desk_printer_info *block);
  121. /*
  122.  * Reads information on the printer driver.
  123.  */
  124.  
  125.  
  126. extern char *Desk_PDriver_PrinterName(void);
  127. /*
  128.  * This function calls Desk_PDriver_Info, and returns the Printer name returned
  129.  * by that SWI. If no Printer Driver is installed, it returns NULL.
  130.  *
  131.  * NOTE that the returned string should be treated as READ ONLY, as it
  132.  * is a pointer into the PDriver's RMA workspace!
  133.  */
  134.  
  135.  
  136. Desk_os_error *Desk_PDriver_CheckFeatures(Desk_print_features mask, Desk_print_features value);
  137. /*
  138.  * Checks the features of a printer and generates an error if appropriate.
  139.  */
  140.  
  141.  
  142. void    Desk_PDriver_PageSize(Desk_wimp_point *size, Desk_wimp_rect *printable);
  143. /*
  144.  * Find how large the paper and print area are.
  145.  */
  146.  
  147.  
  148. void    Desk_PDriver_SelectJob(Desk_print_job newjob, char *title, Desk_print_job *oldjob);
  149. /*
  150.  * Make a given print job the current one.
  151.  */
  152.  
  153.  
  154. void    Desk_PDriver_CurrentJob(Desk_print_job *current);
  155. /*
  156.  * Get the handle of the current job.
  157.  */
  158.  
  159.  
  160. void    Desk_PDriver_EndJob(Desk_print_job job);
  161. /*
  162.  * End a print job normally.
  163.  */
  164.  
  165.  
  166. void    Desk_PDriver_AbortJob(Desk_print_job job);
  167. /*
  168.  * End a print job without any further output.
  169.  */
  170.  
  171.  
  172. void    Desk_PDriver_GiveRectangle(int Desk_rectangle_id, Desk_wimp_rect *rectangle,
  173.                                 Desk_print_transformation *matrix,
  174.                                 Desk_wimp_point *position, int Desk_background_colour);
  175. /*
  176.  * Specify a rectangle to be printed.
  177.  */
  178.  
  179.  
  180. void    Desk_PDriver_DrawPage(int copies, Desk_wimp_rect *Desk_rectangle_to_print,
  181.                            int Desk_sequence_no, char *page,
  182.                            int *finished, int *Desk_rectangle_id);
  183. /*
  184.  * Called to draw the page after all the rectangles have been specified.
  185.  */
  186.  
  187.  
  188. void    Desk_PDriver_GetRectangle(Desk_wimp_rect *Desk_rectangle_to_print,
  189.                                int *finished, int *Desk_rectangle_id);
  190. /*
  191.  * Get the next print rectangle
  192.  */
  193.  
  194.  
  195. void    Desk_PDriver_CancelJob(Desk_print_job job);
  196. /*
  197.  * Stop the print job from printing.
  198.  */
  199.  
  200.  
  201. void    Desk_PDriver_ScreenDump(Desk_print_job job);
  202. /*
  203.  * Output a screen dump to the printer.
  204.  */
  205.  
  206.  
  207. void    Desk_PDriver_EnumerateJobs(Desk_print_job *handle);
  208. /*
  209.  * List existing print jobs.
  210.  */
  211.  
  212.  
  213. void    Desk_PDriver_CancelJobWithError(Desk_print_job job, Desk_os_error *error);
  214. /*
  215.  * Cancels a print job - future attempts to output to it generate an error.
  216.  */
  217.  
  218.  
  219. void    Desk_PDriver_SelectIllustration(Desk_print_job newjob, char *title,
  220.                                      Desk_print_job *oldjob);
  221. /*
  222.  * Makes the given print job the current one, and treats it as an
  223.  * illustration.
  224.  */
  225.  
  226.  
  227. void    Desk_PDriver_InsertIllustration(int Desk_illustration_handle, void *drawpath,
  228.                                      Desk_wimp_point *Desk_bottom_left,
  229.                                      Desk_wimp_point *Desk_bottom_right,
  230.                                      Desk_wimp_point *Desk_top_left);
  231. /*
  232.  * Inserts a file containing an illustration into the current job's output.
  233.  *
  234.  * NOTE - the drawpath will be changed from a void * when drawfile support is
  235.  * added to DeskLib.
  236.  */
  237.  
  238. #ifdef __cplusplus
  239. }
  240. #endif
  241.  
  242.  
  243. #endif
  244.